// pages/city/city.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    cities:[
      {title:'热门城市',children:[
        {name:'上海',value:'shanghai',id:1},
        {name:'北京',value:'beijing',id:2},
        {name:'天津',value:'tianjin',id:3},
        {name:'广州',value:'guangzhou',id:4},
        {name:'深圳',value:'shenzhen',id:5},
        {name:'南京',value:'nanjing',id:6},
        {name:'杭州',value:'hangzhou',id:7},
        {name:'武汉',value:'wuhan',id:8},
        {name:'西安',value:'xian',id:9},
        {name:'成都',value:'chengdu',id:10},
      ]},
      {title:'A',children:[
        {name:'阿坝',value:'aba',id:1},
        {name:'鞍山',value:'anshan',id:2},
        {name:'安阳',value:'anyang',id:3},
        {name:'安康',value:'ankang',id:4},
        {name:'安庆',value:'anqing',id:5},
        {name:'阿拉善',value:'alashan',id:6},
        {name:'阿拉尔',value:'alaer',id:7},
        {name:'阿克苏',value:'akesu',id:8},
        {name:'阿勒泰',value:'aletai',id:9},
        {name:'安顺',value:'anshun',id:10},
        {name:'阿里',value:'ali',id:11},
        {name:'澳门',value:'aomen',id:12},
      ]},
      {title:'B',children:[
        {name:'巴中',value:'bazhong',id:1},
        {name:'本溪',value:'benxi',id:2},
        {name:'滨州',value:'binzhou',id:3},
        {name:'白山',value:'baishan',id:4},
        {name:'宝鸡',value:'baoji',id:5},
        {name:'阿拉善',value:'alashan',id:6},
        {name:'阿拉尔',value:'alaer',id:7},
        {name:'阿克苏',value:'akesu',id:8},
        {name:'阿勒泰',value:'aletai',id:9},
        {name:'安顺',value:'anshun',id:10},
        {name:'阿里',value:'ali',id:11},
        {name:'澳门',value:'aomen',id:12},
      ]},
      {title:'C',children:[
        {name:'巴中',value:'bazhong',id:1},
        {name:'本溪',value:'benxi',id:2},
        {name:'滨州',value:'binzhou',id:3},
        {name:'白山',value:'baishan',id:4},
        {name:'宝鸡',value:'baoji',id:5},
        {name:'阿拉善',value:'alashan',id:6},
        {name:'阿拉尔',value:'alaer',id:7},
        {name:'阿克苏',value:'akesu',id:8},
        {name:'阿勒泰',value:'aletai',id:9},
        {name:'安顺',value:'anshun',id:10},
        {name:'阿里',value:'ali',id:11},
        {name:'澳门',value:'aomen',id:12},
      ]},
      {title:'D',children:[
        {name:'巴中',value:'bazhong',id:1},
        {name:'本溪',value:'benxi',id:2},
        {name:'滨州',value:'binzhou',id:3},
        {name:'白山',value:'baishan',id:4},
        {name:'宝鸡',value:'baoji',id:5},
        {name:'阿拉善',value:'alashan',id:6},
        {name:'阿拉尔',value:'alaer',id:7},
        {name:'阿克苏',value:'akesu',id:8},
        {name:'阿勒泰',value:'aletai',id:9},
        {name:'安顺',value:'anshun',id:10},
        {name:'阿里',value:'ali',id:11},
        {name:'澳门',value:'aomen',id:12},
      ]},
      {title:'E',children:[
        {name:'巴中',value:'bazhong',id:1},
        {name:'本溪',value:'benxi',id:2},
        {name:'滨州',value:'binzhou',id:3},
        {name:'白山',value:'baishan',id:4},
        {name:'宝鸡',value:'baoji',id:5},
        {name:'阿拉善',value:'alashan',id:6},
        {name:'阿拉尔',value:'alaer',id:7},
        {name:'阿克苏',value:'akesu',id:8},
        {name:'阿勒泰',value:'aletai',id:9},
        {name:'安顺',value:'anshun',id:10},
        {name:'阿里',value:'ali',id:11},
        {name:'澳门',value:'aomen',id:12},
      ]},
      {title:'F',children:[
        {name:'巴中',value:'bazhong',id:1},
        {name:'本溪',value:'benxi',id:2},
        {name:'滨州',value:'binzhou',id:3},
        {name:'白山',value:'baishan',id:4},
        {name:'宝鸡',value:'baoji',id:5},
        {name:'阿拉善',value:'alashan',id:6},
        {name:'阿拉尔',value:'alaer',id:7},
        {name:'阿克苏',value:'akesu',id:8},
        {name:'阿勒泰',value:'aletai',id:9},
        {name:'安顺',value:'anshun',id:10},
        {name:'阿里',value:'ali',id:11},
        {name:'澳门',value:'aomen',id:12},
      ]},
      {title:'G',children:[
        {name:'巴中',value:'bazhong',id:1},
        {name:'本溪',value:'benxi',id:2},
        {name:'滨州',value:'binzhou',id:3},
        {name:'白山',value:'baishan',id:4},
        {name:'宝鸡',value:'baoji',id:5},
        {name:'阿拉善',value:'alashan',id:6},
        {name:'阿拉尔',value:'alaer',id:7},
        {name:'阿克苏',value:'akesu',id:8},
        {name:'阿勒泰',value:'aletai',id:9},
        {name:'安顺',value:'anshun',id:10},
        {name:'阿里',value:'ali',id:11},
        {name:'澳门',value:'aomen',id:12},
      ]},
      {title:'H',children:[
        {name:'巴中',value:'bazhong',id:1},
        {name:'本溪',value:'benxi',id:2},
        {name:'滨州',value:'binzhou',id:3},
        {name:'白山',value:'baishan',id:4},
        {name:'宝鸡',value:'baoji',id:5},
        {name:'阿拉善',value:'alashan',id:6},
        {name:'阿拉尔',value:'alaer',id:7},
        {name:'阿克苏',value:'akesu',id:8},
        {name:'阿勒泰',value:'aletai',id:9},
        {name:'安顺',value:'anshun',id:10},
        {name:'阿里',value:'ali',id:11},
        {name:'澳门',value:'aomen',id:12},
      ]},
      {title:'I',children:[
        {name:'巴中',value:'bazhong',id:1},
        {name:'本溪',value:'benxi',id:2},
        {name:'滨州',value:'binzhou',id:3},
        {name:'白山',value:'baishan',id:4},
        {name:'宝鸡',value:'baoji',id:5},
        {name:'阿拉善',value:'alashan',id:6},
        {name:'阿拉尔',value:'alaer',id:7},
        {name:'阿克苏',value:'akesu',id:8},
        {name:'阿勒泰',value:'aletai',id:9},
        {name:'安顺',value:'anshun',id:10},
        {name:'阿里',value:'ali',id:11},
        {name:'澳门',value:'aomen',id:12},
      ]},
      {title:'J',children:[
        {name:'巴中',value:'bazhong',id:1},
        {name:'本溪',value:'benxi',id:2},
        {name:'滨州',value:'binzhou',id:3},
        {name:'白山',value:'baishan',id:4},
        {name:'宝鸡',value:'baoji',id:5},
        {name:'阿拉善',value:'alashan',id:6},
        {name:'阿拉尔',value:'alaer',id:7},
        {name:'阿克苏',value:'akesu',id:8},
        {name:'阿勒泰',value:'aletai',id:9},
        {name:'安顺',value:'anshun',id:10},
        {name:'阿里',value:'ali',id:11},
        {name:'澳门',value:'aomen',id:12},
      ]},
      {title:'Kq',children:[
        {name:'巴中',value:'bazhong',id:1},
        {name:'本溪',value:'benxi',id:2},
        {name:'滨州',value:'binzhou',id:3},
        {name:'白山',value:'baishan',id:4},
        {name:'宝鸡',value:'baoji',id:5},
        {name:'阿拉善',value:'alashan',id:6},
        {name:'阿拉尔',value:'alaer',id:7},
        {name:'阿克苏',value:'akesu',id:8},
        {name:'阿勒泰',value:'aletai',id:9},
        {name:'安顺',value:'anshun',id:10},
        {name:'阿里',value:'ali',id:11},
        {name:'澳门',value:'aomen',id:12},
      ]}
    ]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  },

  /**
   * 选择城市
   */
  selectCity:function(e){
    const eventChannel = this.getOpenerEventChannel()
    eventChannel.emit('acceptDataFromOpenedPage', {data: e.currentTarget.dataset['index']});
    wx.navigateBack();
  }
})